import { getBackgroundAudioManager, Throttler } from "../../utils/util.js";
Page({
  data: {
    list: [
      {
        name: "radio,checkbox组件",
        icon: "🚓",
        type: "radio",
      },
      {
        name: "播放音乐组件",
        icon: "🚙",
        type: "audio",
      },
      {
        name: "文字跑马灯组件",
        icon: "🚌",
        type: "text",
      },
      {
        name: "vr全景图效果",
        icon: "🛺",
        type: "vr",
      },
      {
        name: "获取网络状态",
        icon: "🚑",
        type: "network",
      },
      {
        name: "弹幕滚动效果",
        icon: "🚎",
        type: "bullet",
      },
      {
        name: "echarts地图",
        icon: "🚜",
        type: "chart",
      },
      {
        name: "textarea与input的坑",
        icon: "🚑",
        type: "textareaBug",
      },
      {
        name: "behaviors学习",
        icon: "🚛",
        type: "behaviors",
      },
      {
        name: "skew画各种四边形",
        icon: "🚜",
        type: "skew",
      },
      {
        name: "用户引导效果",
        icon: "🦼",
        type: "guide",
      },
      {
        name: "摄像机自定义",
        icon: "🚋",
        type: "camera",
      },
      {
        name: "重写Page生命周期",
        icon: "🚋",
        type: "rewritePage",
      },
      {
        name: "反向渲染列表",
        icon: "🚋",
        type: "reverseList",
      },
      {
        name: "图片拖拽排序",
        icon: "🚋",
        type: "moveable",
      },
    ],
    buttons: [{ text: "取消" }, { text: "确认" }],
  },
  onLoad() {},
  bindNav(e) {
    const { type } = e.currentTarget.dataset;
    let url = "";
    switch (type) {
      case "radio":
        url = "/pages/radio-checkbox/index";
        break;
      case "audio":
        url = "/pages/audio/index";
        break;
      case "text":
        url = "/pages/text/index";
        break;
      case "vr":
        url = "/pages/vrImg/index";
        break;
      case "network":
        url = "/pages/network/index";
        break;
      case "bullet":
        url = "/pages/bullet/index";
        break;
      case "chart":
        url = "/pages/charts/index";
        break;
      case "textareaBug":
        url = "/pages/textareaBug/index";
        break;
      case "behaviors":
        url = "/pages/behaviors/index";
        break;
      case "skew":
        url = "/pages/skew/index";
        break;
      case "guide":
        url = "/pages/guide/index";
        break;
      case "keyboard":
        url = "/pages/keyboard/index";
        break;
      case "camera":
        url = "/pages/camera/index";
        break;
      case "rewritePage":
        url = "/pages/rewritePage/index";
        break;
      case "reverseList":
        url = "/pages/reverse-list/index";
        break;
      case "moveable":
        url = "/pages/moveable/index";
        break;
      default:
        break;
    }
    wx.navigateTo({
      url,
    });
  },
});
